<?php
if(!interface_exists('XLocaleHolder', false)){
	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'XLocaleHolder.php');
}
abstract class XAbstractLocaleHolder implements XLocaleHolder{
	protected $locale = null;
	protected $locales = array();

	/**
	 * @return array
	 */	
	public function locales(){
		if(count($this->locales) == 0){			
			$this->load();
		}
		return $this->locales;
	}
	
	/**
	 * @return mixed
	 */	
	public function getLocale(){
		if(is_null($this->locale)){
			$this->load();
		}
		return $this->locale;
	}
	
	/**
	 * @return XAbstractLocaleHolder
	 */
	public function setLocale($locale){
		$this->setup($locale);
		$this->locale = $locale;
		return $this;
	}
		
	protected function load(){
	}
	
	protected function setup($locale){
	}
}
?>